package cn.hiapi.shopkeeper.entity.activity;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.serializer.LongToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author AdinZ
 * @date 2022/12/13 0:13
 */
@Entity
@Table(name = "hiapi_shopkeeper_activity_lottery")
@ApiModel(description = "抽奖活动")
@Getter
@Setter
public class ActivityLottery extends BasicEntity {
    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake", strategy = "cn.hiapi.basic.id.SnowflakeId")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;

    @ApiModelProperty("活动id")
    private long aid;
    @ApiModelProperty("店铺id")
    private long shopId;
    @ApiModelProperty("模板类型")
    private int template;

    @ApiModelProperty("日抽奖次数")
    private int dayCount;

    @ApiModelProperty("日中奖次数")
    private int dayLottery;

    @ApiModelProperty("中奖概率")
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal rate = BigDecimal.ZERO;

    @ApiModelProperty("团购价格")
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal price = BigDecimal.ZERO;


    @ApiModelProperty("活动详情")
    @Column(columnDefinition = "text")
    private String body;

}
